import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.*;
/**
 * 
 * SWT display and shell
 *
 */
public class SWTUtil {
    private static Display display = new Display();	

      public Shell getShell() {
         Shell shell = new Shell(display,SWT.ON_TOP  | SWT.CLOSE | SWT.TITLE | SWT. MIN);
         return shell;
    }
	
   public static void openShell(Shell shell) {
        shell.open();
		
        // This loop keeps the shell open constantly listening for events 
       while (!shell.isDisposed()) {
	    if (!display.readAndDispatch()) {
	        display.sleep();
	    }
       }
       shell.dispose();		
    }
  public static void closeDisplay() {
	  display.dispose();
  }
  public Display getDisplay() {
	  return display;
  }
}
